//package com.corpgovernment.organization.config;
//
//import com.alibaba.druid.pool.DruidDataSource;
//import lombok.Data;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//
//import javax.sql.DataSource;
//
///**
// * @program: parent
// * @description: durid数据源配置
// * @author: wubing
// * @create: 2019-05-21 11:09
// */
//@Data
//@Configuration
//public class DruidConfig {
//
//    @Autowired
//    private DbProperties dbProperties;
//
//    @Bean
//    @Primary
//    public DataSource dataSourceDruid() {
//        DruidDataSource dataSource = new DruidDataSource();
//        dataSource.setDriverClassName(dbProperties.getDruidClassName());
//        dataSource.setUrl("jdbc:mysql://10.60.48.100:3306/corpgovernment_standard?useUnicode=true&characterEncoding=UTF-8&useTimezone=true&serverTimezone=GMT%2B8&allowMultiQueries=true");
//        dataSource.setUsername("root");
//        dataSource.setPassword("#EDC5rdx");
//        dataSource.setInitialSize(dbProperties.getInitialSize());
//        dataSource.setMaxActive(dbProperties.getMaxActive());
//        dataSource.setMinIdle(dbProperties.getMinIdle());
//        dataSource.setMaxWait(dbProperties.getMaxWait());
//        dataSource.setTimeBetweenEvictionRunsMillis(dbProperties.getTimeBetweenEvictionRunsMillis());
//        dataSource.setValidationQuery(dbProperties.getValidationgQuery());
//        dataSource.setTestWhileIdle(dbProperties.isTestWhileIdle());
//        return dataSource;
//    }
//
//}